import mongoose, { Schema } from 'mongoose';

const schema = new Schema(
  {
    aggregationAt: {
      type: String,
    },
    contactCount: {
      type: Number,
    },
    assistantReply: [
      {
        replyCount: Number,
        assistantName: String,
      },
    ],
    createdAt: { type: Date, default: Date.now, index: true },
  },
  {
    collection: 'aggregation',
  },
);

schema.index({ aggregationAt: 1 });

export default mongoose.model('Aggregation', schema);
